package HomeElements;

import android.support.test.uiautomator.By;
import android.support.test.uiautomator.BySelector;
import android.support.test.uiautomator.UiSelector;

/**
 * Created by zhe.xiao on 2017/6/22.
 */

public class BySelectorElementType {
    /**
     * 首页
     */
    public static BySelector shouYe(){
        return By.text("首页");
    }
    /**
     * 广告
     */
    public static BySelector guangGao(){
        return By.res("com.mqunar.ad:id/pub_ad_img_btn");
    }

    /**
     * 签证*WiFi
     */
    public static BySelector wifi(){
        return By.text("签证·WiFi");
    }

    /**
     * 出境游
     */

    public static BySelector chuJingYou(){
        return By.text("出境游");
    }

    /**
     * 接送机
     */
    public static BySelector jieJiSong(){
        return By.text("接送机");
    }

    /**
     *一日游
     */
    public static BySelector yiRiYou(){
        return By.text("一日游");
    }

    /**
     * 智慧旅行
     */
    public static BySelector zhiHuiLvXing(){
        return By.text("智慧旅游");
    }

    /**
     * 定制游
     */
    public static BySelector dingZhiYou(){
        return By.text("定制游");
    }

    /**
     * 特色住
     */
    public static BySelector teSeZhu(){
        return By.text("特色住");
    }

    /**
     * 领券中心
     */
    public static BySelector lingQuanZhongXin(){
        return By.text("领券中心");
    }

    /**
     * 踏青赏花
     */
    public static BySelector taQingShangHua(){
        return By.text("踏青赏花");
    }

    /**
     * 特价游
     */
    public static BySelector teJiaYou(){
        return By.text("特价游");
    }

    /**
     * 大搜入口
     */
    public static BySelector daSou(){
        return By.res("com.mqunar.atom.alexhome:id/atom_alexhome_search_edittext");
    }

    /**
     * 最近关注更多
     */

    public static BySelector zuiJinGuanZhuMore(){
        return By.textStartsWith("最近关注");
    }

    /**
     * 最近关注第二个
     */
    public static UiSelector zuiJinGuanZhu2(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_recent_product_img").instance(1);
    }

    /**
     * 您可能想去第一个标签
     */
    public static UiSelector ninKeNeng1tag(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_poi_container").childSelector(new UiSelector().className("android.widget.RadioButton").instance(0));
    }

    /**
     * 您可能想去第二个标签
     */
    public static UiSelector ninKeNeng2tag(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_poi_container").childSelector(new UiSelector().className("android.widget.RadioButton").instance(1));
    }

    /**
     * 您可能想去第三个标签
     */
    public static UiSelector ninKeNeng3tag(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_poi_container").childSelector(new UiSelector().className("android.widget.RadioButton").instance(2));
    }

    /**
     * 您可能想去的全部标签
     */
    public static BySelector ninKeNengMore(){
        return By.text("全部");
    }

    /**
     * 热门目的地第一个标签
     */
    public static UiSelector reMenMu1(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_search_card").childSelector(new UiSelector().className("android.widget.ImageView").instance(0));
    }

    /**
     * 热门目的地第二个标签
     */
    public static UiSelector reMenMu2(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_search_card").childSelector(new UiSelector().className("android.widget.ImageView").instance(1));
    }

    /**
     * 热门目的地第三个标签
     */
    public static UiSelector reMenMu3(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_search_card").childSelector(new UiSelector().className("android.widget.ImageView").instance(2));
    }

    /**
     * 热门目的地更多
     */
    public static UiSelector reMenMuMore(){
        return new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_search_card_container").childSelector(new UiSelector().resourceId("com.mqunar.atom.alexhome:id/atom_alexhome_card_title_more_container"));
    }

    /**
     * 热门专题第一个标签
     */
    public static BySelector reMenZhuan1(){
        return By.text("热门专题");
    }

    /**
     * 热门专题第二个标签
     */
    public static BySelector reMenZhuan2(){
        return By.text("热门专题");
    }

    /**
     * 热门专题第三个标签
     */
    public static BySelector reMenZhuan3(){
        return By.text("热门专题");
    }

    /**
     * 热门专题更多
     */
    public static BySelector reMenZhuanMore(){
        return By.text("热门专题");
    }

    /**
     *首页可滑动的viewlist
     */
    public static UiSelector homeViewList(){
        return new UiSelector().resourceId("android:id/list").scrollable(true);
    }

    /**
     * 最近关注酒店类型验证
     */
    public static BySelector hoemHotel(){
        BySelector by = By.res("com.mqunar.atom.alexhome:id/atom_alexhome_mod_hotel");
        return by;
    }
    public static BySelector hotelSearch(){
        BySelector by = By.text("开始搜索");
        return by;
    }
    public static BySelector hotelDan(){
        BySelector by = By.res("android:id/list");
        return by;
    }

    /**
     * 最近关注景点类型验证
     */
    public static BySelector ticketZuiJinGuanZhu(){
        BySelector by = By.res("com.mqunar.atom.voice:id/atom_voice_title_search_edittext");
        return by;
    }
    public static BySelector ticketSearch(){
        BySelector by = By.res("com.mqunar.atom.voice:id/atom_voice_city_ch");
        return by;
    }
    public static BySelector ticketDan(){
        BySelector by = By.res("android:id/list").depth(10, 12);
        return by;
    }

    /**
     * 6+1广告
     */
    public static BySelector guangGao6(){
        BySelector by = By.clazz("android.widget.LinearLayout").res("com.mqunar.atom.alexhome:id/atom_alexhome_marketing_card_container");
        return by;
    }

    /**
     * 点击酒店名字
     */
    public static BySelector hotelName(){
        BySelector by = By.res("com.mqunar.atom.hotel:id/atom_hotel_txCity");
        return by;
    }

    /**
     * 输入酒店名字
     */
    public static BySelector nameSend(){
        BySelector by = By.res("com.mqunar.atom.hotel:id/atom_hotel_title_etSearch");
        return by;
    }

    /**
     * 点击第一个酒店名字
     */
    public static BySelector hotelName1(){
        BySelector by = By.res("com.mqunar.atom.hotel:id/atom_hotel_city_name");
        return by;
    }
}
